import { createRouter, createWebHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/login', 
    },
    {
      path: '/management',
      component: () => import('../views/management.vue'),
      children: [
        {
          path: '/student/home',
          name: 'StudentHome',
          component: () => import('@/views/student/Home.vue')
        },
        {
          path: '/company/home',
          name: 'CompanyHome',
          component: () => import('@/views/company/Home.vue')
        },
        {
          path: '/student/user',
          name: 'StudentUser',
          component: () => import('../views/student/User.vue'),
        },
        {
          path: '/company/user',
          name: 'CompanyUser',
          component: () => import('../views/company/User.vue'),
        },
        // {
        //   path: 'test',
        //   name: 'test',
        //   component: () => import('../views/test.vue'),
        // },
        // {
        //   path: 'data',
        //   name: 'data',
        //   component: () => import('../views/data.vue'),
        // },
        
        // {
        //   path: 'chat',
        //   name: 'chat',
        //   component: () => import('../views/chat.vue'),
        // },
        // {
        //   path: 'Exam',
        //   name: 'Exam',
        //   component: () => import('../views/ExamAI.vue'),
        // },
        // {
        //   path: 'Listener',
        //   name: 'Listener',
        //   component: () => import('../views/Listener.vue'),
        // },
      ]
    },
    {
      path: '/404',
      name: 'Notfound',
      meta: { title: '404 找不到页面' },
      component: () => import('../views/404.vue'),
    },
    {
      path: '/:pathMatch(.*)*',
      redirect: '/404',
      name: 'notFound',
      meta: { title: '404 找不到页面' },
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import('../views/Login.vue'),
    },
    {
      path: '/register',
      name: 'Register',
      component: () => import('../views/Register.vue'),
    },
    // {
    //   path: '/grades',
    //   name: 'Grades',
    //   component: () => import('../views/Grades.vue'),
    // },
    // {
    //   path: '/learning',
    //   name: 'Learning',
    //   component: () => import('../views/Learning.vue'),
    // },
    // {
    //   path: '/profile',
    //   name: 'Profile',
    //   component: () => import('../views/Profile.vue'),
    // },
    // {
    //   path: '/xunfei',
    //   name: 'Xunfei',
    //   component: () => import('../views/xunfei.vue'),
    // },
    // {
    //   path: '/chat',
    //   name: 'chat',
    //   component: () => import('../views/chat.vue'),
    // },
  ],
})

export default router
